<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>板块维护</title>
        <style>
            table, th, td {
              border: 1px solid black;
              border-collapse: collapse;
            }
            th, td {
              padding: 1px;
              text-align: left;
            }
            .tabs {
                position: relative;
                min-height: 4000px;  /*This part sucks */
                clear: both;
                margin: 15px 0;
            }
            .tab {
                float: left;
            }
            .tab label {
                background: #eee;
                padding: 1px;
                border: 1px solid #ccc;
                margin-left: -1px;
                position: relative;
                left: 1px;
            }
            .tab [type=radio] {
                display: none;
            }
            .content {
                position: absolute;
                top: 25px;
                left: 0;
                background: white;
                right: 0;
                bottom: 0;
                padding: 2px;
                border: 1px solid #ccc;
            }
            [type=radio]:checked ~ label {
                background: white;
                border-bottom: 1px solid white;
                z-index: 2;
            }
            [type=radio]:checked ~ label ~ .content {
                z-index: 1;
            }
        </style>
    </head>
    <body>
        <section>
            <h5>文件日期</h5>
            <p>
                今天:{{now_date}} | 文件:{{last_date}}
            </p>
            <ul>
                <li>
                    <form action="{% url 'webIndex:block_update_btn_exec' %}" method="get">
                        <button type="submit">板块文件更新</button>
                    </form>
                </li>
            </ul>
            <h6>当前板块数量({{last_date}})</h6>
            <table style="width:100%">
                <!-- <caption style="text-align: center;">股票总体分布</caption> -->
                <tr>
                    <th>细分行业</th>
                    <th>概念</th>
                    <th>风格</th>
                    <th>指数</th>
                </tr>
                <tr>
                    <td>{{block_itemnum.hy}}</td> 
                    <td>{{block_itemnum.gn}}</td>
                    <td>{{block_itemnum.fg}}</td>
                    <td>{{block_itemnum.zs}}</td>
                </tr>
            </table>
        
        </section>
        <hr>
        <section>
            <h6>当前板块详情({{last_date}})</h6>
            <div class="tabs">
                <div class="tab">
                    <input type="radio" id="tab-1" name="tab-group-1" checked>
                    <label for="tab-1">概念板块</label>
                    <div class="content">
                        <table style="width:100%">
                            <tr>
                                <th>序号</th>
                                <th>代码</th>
                                <th>名称</th>
                                <th>数量</th>
                            </tr>
                            {% for block in gn_blocklist %}
                            <tr>
                                <td>{{forloop.counter}}</td>
                                <td>{{block.block_code}}</td>
                                <td>{{block.block_name}}</td>
                                <td>{{block.total_num}}</td>
                            </tr>
                            {% endfor  %}
                        </table>
                    </div>
                </div>
             
                <div class="tab">
                    <input type="radio" id="tab-2" name="tab-group-1">
                    <label for="tab-2">细分行业</label>
                    <div class="content">
                        <table style="width:100%">
                            <tr>
                                <th>序号</th>
                                <th>代码</th>
                                <th>名称</th>
                                <th>数量</th>
                            </tr>
                            {% for block in hy_blocklist %}
                            <tr>
                                <td>{{forloop.counter}}</td>
                                <td>{{block.block_code}}</td>
                                <td>{{block.block_name}}</td>
                                <td>{{block.total_num}}</td>
                            </tr>
                            {% endfor  %}
                        </table>
                    </div>
                </div>
                <div class="tab">
                    <input type="radio" id="tab-3" name="tab-group-1">
                    <label for="tab-3">主要指数</label>
                    <div class="content">
                        <table style="width:100%">
                            <tr>
                                <th>序号</th>
                                <th>代码</th>
                                <th>名称</th>
                                <th>数量</th>
                            </tr>
                            {% for block in zs_blocklist %}
                            <tr>
                                <td>{{forloop.counter}}</td>
                                <td>{{block.block_code}}</td>
                                <td>{{block.block_name}}</td>
                                <td>{{block.total_num}}</td>
                            </tr>
                            {% endfor  %}
                        </table>
                    </div>
                </div>
                <div class="tab">
                    <input type="radio" id="tab-4" name="tab-group-1">
                    <label for="tab-4">风格</label>
                    <div class="content">
                        <table style="width:100%">
                            <tr>
                                <th>序号</th>
                                <th>代码</th>
                                <th>名称</th>
                                <th>数量</th>
                            </tr>
                            {% for block in fg_blocklist %}
                            <tr>
                                <td>{{forloop.counter}}</td>
                                <td>{{block.block_code}}</td>
                                <td>{{block.block_name}}</td>
                                <td>{{block.total_num}}</td>
                            </tr>
                            {% endfor  %}
                        </table>
                    </div>
                </div>
            </div>
            
            

            
        </section>

    </body>
</html>    